package com.yhsimon.realm.member.controller;

import com.yhsimon.realm.member.service.SeckillService;
import com.yhsimon.realm.member.utils.R;
import com.yhsimon.realm.member.vo.user.SeckillBeanActivityVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member/seckill")
public class SeckillController {

    @Autowired
    private SeckillService seckillService;

    @GetMapping("/seckillBean")
    public R seckillBean(@RequestParam("userId") Long userId, @RequestParam("seckillCount") Long seckillCount) {
        return seckillService.seckillBean(userId, seckillCount);
    }

    @GetMapping("/listSeckillBeanActivity")
    public R listSeckillBeanActivity() {
        SeckillBeanActivityVo seckillBeanActivityVo = seckillService.listSeckillBeanActivity();
        return R.ok().put("data", seckillBeanActivityVo);
    }

}
